<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Calling Functions</title>
    <script>
      function buttonReport(id, name, value) {
        // 按钮id信息
        const userMessage1 = `Button id: ${id}\n`;
        // 按钮名称
        const userMessage2 = `Button name: ${name}\n`;
        // 按钮值
        const userMessage3 = `Button value: ${value}\n`;
        // 提醒用户
        alert(userMessage1 + userMessage2 + userMessage3);
      }
    </script>
  </head>
  <body>
    <input
      type="button"
      id="id1"
      name="Left Hand Button"
      value="Left"
      onclick="buttonReport(this.id,this.name,this.value)"
    />
    <input
      type="button"
      id="id2"
      name="Center Button"
      value="Center"
      onclick="buttonReport(this.id,this.name,this.value)"
    />
    <input
      type="button"
      id="id3"
      name="Right Hand Button"
      value="Right"
      onclick="buttonReport(this.id,this.name,this.value)"
    />
  </body>
</html>
